<?php

if (!isset($_GET['id'])) header("Location: stanice.php");

$id = $_GET['id'];

$query = "SELECT * FROM stanica WHERE id=" . $id . ";";

$result = myQuery($query);

if (! ($row = mysql_fetch_array($result))) header("Location: stanice.php");

$spremnik = dbGetNazivFromId("spremnik", $row['spremnik']);
$podrijetlo = dbGetNazivFromId("podrijetlo", $row['podrijetlo']);
$izotip = dbGetNazivFromId("izotip", $row['izotip']);
$medij = dbGetNazivFromId("medij", $row['medij']);

?>

<table>
<tr>
<td width='50%'>
	<div class='content'>
	<span class='contentTitle'> Informacije o stanici </span>
	<table class='tableResult' cellspacing='0' width='100%'>
	<tr> 
		<th scope='row' class='spec' width='110px' > Naziv </th> 
		<td> 
			<?php print($row['naziv']);?>
		</td>
	</tr>
	
	<tr>
		<th scope='row' class='spec' > Podrijetlo </th> 
		<td>
			<?php print($podrijetlo);?>
		</td>
	</tr>
	
	<tr>
		<th scope='row' class='spec' > Izotip </th> 
		<td>
			<?php print($izotip); ?>
		</td>
	</tr>
	
	<tr>
		<th scope='row' class='spec' > Medij </th> 
		<td>
			<?php print($medij); ?>
		</td>
	</tr>

	<tr> 
		<th scope='row' class='spec' > Dodatak<br>u medij </th> 
		<td>
			<?php print($row['dodatak']); ?>
		</td> 
	</tr>
	
	<tr> 
		<th scope='row' class='spec' > Karakteristike </th> 
		<td>
			<?php print($row['karakteristike']); ?>
		</td> 
	</tr>
		
	<tr> 
		<th scope='row' class='spec' > Referenca </th> 
		<td>
			<?php print($row['referenca']); ?>
		</td> 
	</tr>
	
	<tr> 
		<th scope='row' class='spec' > Pasaža </th> 
		<td>
			<?php print($row['pasaza']); ?>
		</td> 
	</tr>
	
	<tr> 
		<th scope='row' class='spec' > Opaska </th> 
		<td>
			<?php print($row['opaska']); ?>
		</td> 
	</tr>
				
	<tr> 
		<th scope='row' class='spec' > Vlasnik </th> 
		<td> 
			<?php print($row['vlasnik']); ?>
		</td> 
	</tr>
	
	<tr> 
		<th scope='row' class='spec' > Link </th> 
		<td> 
			<?php print("<a href='http://".  $row['link'] . "'> " . $row['link'] . "</a>"); ?>
		</td> 
	</tr>
	
	</table>
	</div>
</td>

<td valign="top">
	<div class='content'>
	<span class='contentTitle'> Lokacija u tekućem dušiku  </span>
	<table class='tableResult' cellspacing='0' width='100%'>
	<tr> 
		<th scope='row' class='spec' style='width: 100px'> Spremnik </th> 
		<td>
			<?php print($spremnik) ?>
		</td>
	</tr>
		
	<tr> 
		<th scope='row' class='spec' > Pozicija </th> 
		<td>
			<?php print($row['pozicija']); ?>
		</td>
	</tr>
	
	<tr> 
		<th scope='row' class='spec' > Datum spremanja </th> 
		<td> 
			<?php print($row['datum']); ?>
		</td>
	</tr>

	
	<tr> 
		<th scope='row' class='spec' > Osoba koja je spremila stanicu </th> 
		<td> 
			<?php print($row['osoba']); ?>
		</td> 
	</tr>
	</table>
	</div>
</td>

</tr>
</table>

<?php print("</form>"); ?>